package testing;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class CharByteConversion
{
	public static void main(String[] args) throws IOException
	{
		BufferedReader in = new BufferedReader(new FileReader("3arabi.txt"));
		String arabi = in.readLine();
		in.close();
		byte[] buff = new byte[arabi.length()];
		for (int i = 0; i < buff.length; i++)
			buff[i] = (byte) arabi.charAt(i);
		BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream("lolo.txt"));
		out.write(buff);
		out.close();
		BufferedInputStream in1 = new BufferedInputStream(new FileInputStream("lolo.txt"));
		in1.read(buff);
		in1.close();
		String string = "";
		for (int i = 0; i < buff.length; i++)
		{
			char temp = (char) buff[i];
			if (buff[i] < 0)
				temp += 256;
			string += temp;
		}
		PrintWriter p = new PrintWriter(new FileWriter("3arabi.txt"));
		p.println(string);
		p.close();
	}
}
